import java.util.ArrayList;

import by.wind.drebedengi.datalayer.GetRecordList;
import by.wind.drebedengi.datalayer.SetRecordList;
import by.wind.drebedengi.datalayer.bean.Record;


public class Main {
	
	/**
	 * @param args
	 */
	public static void main(String[] args) {
		System.out.println("It's works!");
		/*CurrencyList cl = new CurrencyList();
		cl.loadData();*/
		//CategoryList catList = new CategoryList();
		
		try {

			GetRecordList rc = new GetRecordList();
			rc.loadData();
			Record record = rc.getRecordList().get(0);
			for(Record element : rc.getRecordList()) {
				if (element.getCategory() != null && element.getOperation_type() == 3) {
					record = element;
					break;
				}
			}
			
			record.setComment("Уру-ру-ру-ру-ру-ру выйдет рано по утру");
			ArrayList<Record> updateRecordList = new ArrayList<Record>();
			updateRecordList.add(record);
			SetRecordList setRecordList = new SetRecordList(updateRecordList);
			setRecordList.loadData();
		} catch (Exception e) {
			e.printStackTrace();
		}
		
	}

}
